package day06;


public class MethodDemo {
    public static void main(String[] args) {
        say();

        sayHi("老干妈");

        sayHello("西蓝花",180);

        sayHello("奥利给",40);

        sayHello("奥利给",40);
        /*
        double a = getNum();
        System.out.println(a);

        int num = plus(4,9);
        System.out.println(num);

        int c = 5,d = 8;
        int e =plus(c,d);
        System.out.println(e);


        int[] arr = testArray(8,1000);
        System.out.println("数组的长度为："+arr.length);
        for (int i = 0;i<arr.length;i++){
            System.out.println(arr[i]);
        }

        int[] f = testArray(5,60);
        System.out.println("第一个元素的值为："+f[0]);
        for (int i = 0;i<f.length;i++){
            System.out.println(f[i]);
        }

         */




        System.out.println("继续执行...");
    }
    public static void say(){
        System.out.println("大家好，我叫LY，今年一百岁了！");

    }
    public static void sayHi(String name){
        System.out.println("大家好，我叫"+name+"今年一百岁了");
    }
    public static void sayHello(String name,int age){
        if (age>50){
            return;
        }
        System.out.println("大家好，我叫"+name+"今年"+age+"岁了");
    }
    public static double getNum(){
        return 8.88;
    }
    public static int plus(int a,int b){
        int num = a+b;
        return num;
    }
    public static int[] testArray(int len,int max){
        int[] arr = new int[len];
        for (int i = 0;i<arr.length;i++){
            arr[i] = (int) (Math.random()*(max+1));
        }
        return arr;
    }

}
